package engine.step;

import engine.GameEngine;
import engine.data.Player;

public final class EndOfPlayerTurnStep extends Step {

	private static Step step;

	public static synchronized Step getStep() {
		if (step == null)
			step = new EndOfPlayerTurnStep();
		return step;
	}

	public Step execute() {
		Player currPlayer = GameEngine.currPlayer;
		currPlayer.played = true;
		currPlayer.controller.onEndOfTurn();
		if (GameEngine.nextPlayer())
			return BeginPlayerTurnStep.getStep();
		return EndOfTurnStep.getStep();
	}
}
